package com.twang.stock.controller.common;

import com.twang.stock.entity.ZhuXianTime;
import com.twang.stock.service.ZhuXianTimeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping(value = "/zhuxian")
@Slf4j
public class ZhuXianController {

    @Autowired
    private ZhuXianTimeService zhuXianTimeService;

    @RequestMapping(value = "")
    public ModelAndView zhuxian() {
        ModelAndView modelAndView = new ModelAndView();
        List<ZhuXianTime> result = zhuXianTimeService.getList();
        modelAndView.addObject("results", result);
        modelAndView.setViewName("zhuXian/zhu_xian");
        return modelAndView;
    }


}
